Package-level declarations

Types

Link copied to clipboard
@Immutable
data class ComposeMapInitOptions(val mapOptions: MapOptions, val textureView: Boolean = false, val antialiasingSampleCount: Int = DEFAULT_ANTIALIASING_SAMPLE_COUNT, val mapName: String = "")

Defines configuration ComposeMapInitOptions for a MapboxMap composable function.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FILE, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.TYPE, AnnotationTarget.TYPE_PARAMETER])
annotation class MapboxMapComposable

Marks a composable function as being expected to be used inside another composable function that is also marked or inferred to be marked as a MapboxMapComposable.

Link copied to clipboard
@Immutable
object MapboxMapScope

A MapboxMapScope provides a scope for the children of MapboxMap.

Link copied to clipboard
@DslMarker
annotation class MapboxMapScopeMarker

Marks the scope of DSL used within MapboxMap composable function.

Link copied to clipboard
@Stable
class MapState

The MapState that can be hoisted to observe map events, query rendered features and control gestures settings.

Functions

Link copied to clipboard
@Composable
fun DisposableMapEffect(key1: Any?, block: DisposableEffectScope.(MapView) -> DisposableEffectResult)
@Composable
fun DisposableMapEffect(vararg keys: Any?, block: DisposableEffectScope.(MapView) -> DisposableEffectResult)
@Composable
fun DisposableMapEffect(key1: Any?, key2: Any?, block: DisposableEffectScope.(MapView) -> DisposableEffectResult)
@Composable
fun DisposableMapEffect(key1: Any?, key2: Any?, key3: Any?, block: DisposableEffectScope.(MapView) -> DisposableEffectResult)

DisposableMapEffect is a DisposableEffect that provides the raw map controller. Use this API to interact with all the raw Mapbox Maps SDK APIs.

Link copied to clipboard
@Composable
fun MapboxMap(modifier: Modifier = Modifier, composeMapInitOptions: ComposeMapInitOptions = with(LocalDensity.current) { remember { ComposeMapInitOptions(density) } }, compass: @Composable MapCompassScope.() -> Unit = { Compass() }, scaleBar: @Composable MapScaleBarScope.() -> Unit = { ScaleBar() }, logo: @Composable MapLogoScope.() -> Unit = { Logo() }, attribution: @Composable MapAttributionScope.() -> Unit = { Attribution() }, mapViewportState: MapViewportState = rememberMapViewportState(), mapState: MapState = rememberMapState(), onMapClickListener: OnMapClickListener? = null, onMapLongClickListener: OnMapLongClickListener? = null, style: @Composable () -> Unit = { MapboxStandardStyle() }, content: @Composable MapboxMapScope.() -> Unit? = null)

Entry point for adding a Mapbox Map instance to the Jetpack Compose UI.

Link copied to clipboard
@Composable
fun MapEffect(key1: Any?, block: suspend CoroutineScope.(MapView) -> Unit)

When MapEffect enters the composition it will launch block into the composition's CoroutineContext. The coroutine will be cancelled and re-launched when MapEffect is recomposed with a different key1.

@Composable
fun MapEffect(vararg keys: Any?, block: suspend CoroutineScope.(MapView) -> Unit)

When MapEffect enters the composition it will launch block into the composition's CoroutineContext. The coroutine will be cancelled and re-launched when MapEffect is recomposed with any different keys.

@Composable
fun MapEffect(key1: Any?, key2: Any?, block: suspend CoroutineScope.(MapView) -> Unit)

When MapEffect enters the composition it will launch block into the composition's CoroutineContext. The coroutine will be cancelled and re-launched when MapEffect is recomposed with a different key1 or key2.

@Composable
fun MapEffect(key1: Any?, key2: Any?, key3: Any?, block: suspend CoroutineScope.(MapView) -> Unit)

When MapEffect enters the composition it will launch block into the composition's CoroutineContext. The coroutine will be cancelled and re-launched when MapEffect is recomposed with a different key1, key2 or key3.

Link copied to clipboard
@Composable
inline fun rememberMapState(key: String? = null, crossinline init: MapState.() -> Unit = {}): MapState

Create and rememberSaveable a MapState using MapState.Saver. init will be called when the MapState is first created to configure its initial state.